<extend name='Public:main' />
<block name="content" >
    <section class="section">
        <div class="step">
            <ul>
                <li class="on"><em>1</em>检测环境</li>
                <li class="on"><em>2</em>创建数据</li>
                <li class="current"><em>3</em>完成安装</li>
            </ul>
        </div>
        <div class="install" id="log">
            <ul id="loginner">
            </ul>
        </div>
        <div class="bottom tac"> <a href="javascript:;" class="btn_old"><img src="__STATIC__/install/images/loading.gif" align="absmiddle" />&nbsp;正在安装...</a> </div>
    </section>
</block>

<block name="script">
    <script src="__STATIC__/install/js/jquery.js"></script>
    <script type="text/javascript">
        var n = 0;
        var data = eval('({:json_encode($_POST)})');
        $.ajaxSetup({cache: false});
        function reloads(n) {
            var url = "{:U('install/index/s4')}?install=1&n=" + n;
            $.ajax({
                type: "POST",
                url: url,
                data: data,
                dataType: 'json',
                beforeSend: function () {

                },
                success: function (msg) {
                    if (msg.n == '999999') {
                        $('#dosubmit').attr("disabled", false);
                        $('#dosubmit').removeAttr("disabled");
                        $('#dosubmit').removeClass("nonext");
                        setTimeout('gonext()', 2000);
                    }
                    if (msg.n) {
                        $('#loginner').append(msg.msg);
                        reloads(msg.n);
                    } else {
                        alert(msg.msg);
                    }
                }
            });
        }
        function gonext() {
            window.location.href = '{:U("install/index/s5")}';
        }
        $(document).ready(function () {
            reloads(n);
        });
    </script> 
</block>